package com.qfedu.fmmall.shopcart.service.impl;

import com.qfedu.fmmall.shopcart.dao.ShoppingCartDao;
import com.qfedu.fmmall.shopcart.service.ShopCartDelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : yanBin
 * @date :2022/2/10 13:46
 */
@Service
public class ShopCartDelServiceImpl implements ShopCartDelService {
    @Autowired
    private ShoppingCartDao shoppingCartDao;

    @Override
    public int delete(String cids) {
        String[] split = cids.split(",");
        List<Integer> list = new ArrayList<>();
        for (String s : split) {
            list.add(Integer.valueOf(s));
        }
        int i = shoppingCartDao.deleteByPrimaryKey(list);
        return i;
    }
}
